/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.general.bc;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.cip.esymons.general.be.Via;

/**
 *
 * @author ADMINISTRADOR
 */
@Stateless
public class ViaFacade implements ViaFacadeLocal {
    @PersistenceContext
    private EntityManager em;

    public void create(Via via) {
        em.persist(via);
    }

    public void edit(Via via) {
        em.merge(via);
    }

    public void remove(Via via) {
        Via aux = em.merge(via);
        em.remove(aux);
    }

    public Via find(Object id) {
        return em.find(Via.class, id);
    }

    public List<Via> findAll() {
        return em.createQuery("select object(o) from Via as o").getResultList();
    }

}
